<template>
  <div class="file-list">
    <ul>
      <li
        v-for="(file, index) in files"
        :key="index"
      >
        <a
          :href="file.fileUrl"
        >
          {{ file.fileName }}
        </a>
      </li>
    </ul>
  </div>
</template>
<script>
import { ref, onMounted, reactive, toRefs } from 'vue'
// import { download } from '@/api/file'
import { convertRes2Blob } from '@/utils'
export default {
  name: 'FileDownload',
  props: {
    files: {
      type: Array,
      default: () => []
    }
  },
  setup(props, { emit }) {
    const downloadFile = async (file) => {
      // const res = await download(file.id)
      // if (res.status === 200) {
      //   convertRes2Blob(res, file.name)
      // }
    }
    return {
      downloadFile
    }
  }
}
</script>
<style lang="scss" scoped>
.file-list {
  ul,
  li {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    .play-icon {
      width: 20px;
      height: 20px;
      vertical-align: middle;
      margin-right: 5px;
    }
    a {
      color: #527dff;
      &:hover {
        text-decoration: underline;
      }
    }
  }
  li {
    margin-bottom: 10px;
  }
}
</style>